home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / bash-1.12 / dist / shell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-21  |  2.0 KB  |  67 lines

  1. /* shell.h -- The data structures used by the shell */
  2.  
  3. #include "config.h"
  4. #include "general.h"
  5. #include "error.h"
  6. #include "variables.h"
  7. #include "quit.h"
  8. #include "maxpath.h"
  9. #include "unwind_prot.h"
  10. #include "command.h"
  11.  
  12. extern int EOF_Reached;
  13.  
  14. #define NO_PIPE -1
  15. #define REDIRECT_BOTH -2
  16. #define IS_DESCRIPTOR -1
  17.  
  18. #define NO_VARIABLE -1
  19.  
  20. /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
  21. #include <setjmp.h>
  22. extern jmp_buf top_level, catch;
  23.  
  24. #define NOT_JUMPED 0        /* Not returning from a longjmp. */
  25. #define FORCE_EOF 1        /* We want to stop parsing. */
  26. #define DISCARD 2        /* Discard current command. */
  27. #define EXITPROG 3        /* Unconditionally exit the program now. */
  28.  
  29. /* Values that can be returned by execute_command (). */
  30. #define EXECUTION_FAILURE 1
  31. #define EXECUTION_SUCCESS 0
  32.  
  33. /* Special exit status used when the shell is asked to execute a
  34.    binary file as a shell script. */
  35. #define EX_BINARY_FILE 126
  36.  
  37. /* The list of characters that are quoted in double-quotes with a
  38.    backslash.  Other characters following a backslash cause nothing
  39.    special to happen. */
  40. #define slashify_in_quotes "\\`$\""
  41. #define slashify_in_here_document "\\`$"
  42.  
  43. /* Constants which specify how to handle backslashes and quoting in
  44.    expand_word_internal ().  Q_DOUBLE_QUOTES means to use the function
  45.    slashify_in_quotes () to decide whether the backslash should be
  46.    retained.  Q_HERE_DOCUMENT means slashify_in_here_document () to
  47.    decide whether to retain the backslash.  Q_KEEP_BACKSLASH means
  48.    to unconditionally retain the backslash. */
  49. #define Q_DOUBLE_QUOTES  0x1
  50. #define Q_HERE_DOCUMENT  0x2
  51. #define Q_KEEP_BACKSLASH 0x4
  52.  
  53. extern char **shell_environment;
  54. extern WORD_LIST *rest_of_args;
  55.  
  56. /* Generalized global variables. */
  57. extern int executing, login_shell;
  58.  
  59. /* Structure to pass around that holds a bitmap of file descriptors
  60.    to close, and the size of that structure.  Used in execute_cmd.c. */
  61. struct fd_bitmap {
  62.   long size;
  63.   char *bitmap;
  64. };
  65.  
  66. #define FD_BITMAP_SIZE 32
  67.